﻿using Furion.CMS.Core.Permission;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Furion.CMS.Core.Permission
{
    /// <summary>
    /// 权限定义上下文
    /// </summary>
    public interface IPermissionDefinitionContext
    {
        /// <summary>
        /// 
        /// </summary>
        IServiceProvider ServiceProvider { get; }
        /// <summary>
        /// 添加权限组(根据传入的泛型类生成权限组代码)
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="displayName"></param>
        /// <returns></returns>
        PermissionGroupDefinition<T> AddGroup<T>(string displayName) where T : class;
        /// <summary>
        /// 添加权限组
        /// </summary>
        /// <param name="code"></param>
        /// <param name="displayName"></param>
        /// <returns></returns>
        PermissionGroupDefinition AddGroup(string code, string displayName);
        /// <summary>
        /// 获取权限组
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        PermissionGroupDefinition GetGroup(string name);
        /// <summary>
        /// 删除权限组
        /// </summary>
        /// <param name="name"></param>
        void RemoveGroup(string name);
    }
}
